/* eslint-disable */
var fs = require('fs');
var path = require('path');

var env = process.env.NODE_ENV || 'prod';
var cfgName = `.env.${env}`;

fs.readFile(path.resolve('config', cfgName), 'utf-8', function (err, data) {
  if (err) throw err;

  var target = path.resolve('dist/config/', cfgName);

  fs.mkdir(path.resolve('dist/config/'),  function (error) {
    if (error) throw error;
  });

  fs.writeFile(target, data, 'utf-8', function (error) {
    if (error) throw error;
  });
});
